<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<link href="images/skin.css" rel="stylesheet" type="text/css" />
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
		<script type="text/javascript"src="js/jquery.min.js"></script>
		<base href="<%=basePath%>">
		<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
.contentTable,.contentTable td,.contentTable th,  {   
    border:1px solid #cccccc;   
    border-collapse:collapse;  
} 
-->
</style>
<script type="text/javascript">
	function check(theform)
	{
		if (theform.area.value==-1)	{
		    alert("请选择地区！");
		    theform.area.focus();
		    return (false);
		  }
		if (theform.serviceType.value==-1)	{
		    alert("请选择业务类型！");
		    theform.serviceType.focus();
		    return (false);
		  }
		if (theform.serviceNum.value=='') {
		    alert("业务号码不能为空！");
		    theform.serviceNum.focus();
		    return (false);
		  }	
		if (theform.masterNum.value=='') {
		    alert("装维人员号码不能为空！");
		    theform.masterNum.focus();
		    return (false);
		  }
		if (theform.supportType.value==-1) {
		    alert("请选择支撑类别！");
		    theform.supportType.focus();
		    return (false);
		  }	
		if (theform.type.value==-1) {
		    alert("请选择故障业务类型！");
		    theform.type.focus();
		    return (false);
		  }	
		if (theform.symptom.value=='') {
		    alert("请选择故障现象！");
		    theform.type.focus();
		    return (false);
		  }	
		  theform.submit();
		  return (true);   
	}
	function resetBtn(fm){
	　　 fm.reset();
	 　　return false;
	}
</script>
<script type="text/javascript">  
    function getCom(){  
        var type=$("#type").val();
        //alert(type);
        
        $.ajax({  
            cache:false,  
            url:'ajaxGetComName.action',  
            type:'post',  
            dataType:'json',  
            data:{type:type},  
            success:update_c  
        });  
    }  
    function update_c(json){  
        var symptomList=json.list;
        //alert(comList); 
        var s_root=document.getElementById('symptom');  
        s_root.options.length=0; 
        var ptype=$("#type").val();
       
        for(var i in symptomList){  
            var option = document.createElement("option");  
            var value=symptomList[i].name;     
            var text=symptomList[i].name;
            var type=symptomList[i].type;
            if(ptype==type){
                option.text=text;  
                option.value=value;  
                s_root.options[s_root.options.length] =option;
            } 
        }
          
    }  
</script>
	</head>
	<body>
		<table width="100%" border="0" cellpadding="0" cellspacing="0" style="">
			<tr>
			    <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
			    <td valign="top" background="images/content-bg.gif">
			    	<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
				      <tr>
				        <td height="31"><div class="titlebt">支撑需求管理</div></td>
				      </tr>
			    	</table>
			    </td>
			    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
		  </tr>
		  
		  <tr >
			<td valign="middle" background="images/mail_leftbg.gif">
				&nbsp;
			</td>
			<td valign="top" bgcolor="#F7F8F9" style="margin-top:10px">
				<table width="90%" border="0" cellpadding="0" cellspacing="0" class="line_table" align="center" style="margin-top:10px">
		          <tr>
		            <td width="2%" height="27" background="images/news-title-bg.gif"><img src="images/news-title-bg.gif" width="2" height="27"></td>
		            <td width="98%" background="images/news-title-bg.gif" class="left_bt2">需求修改</td>
		          </tr>
		          <tr>
		            <td valign="top"></td>
		            <td valign="top" align="center">
		            	<s:form method="post" action="Request!update" id="requestInputForm">
							<table width="100%" border="0"  cellpadding="0" cellspacing="0">
							  <tr>
							    <td colspan="6"><s:if test="hasActionMessages()"><div class="info"><s:actionmessage/></div></s:if></td>
							  </tr>
							  <tr>
							    <td colspan="6" height="25px" bgcolor="#E6E6FA" class="table_content"><strong>用户信息</strong></td>
							  </tr>
							  <tr>
							    <td width="14%" height="40px" class="table_content" align="right" class="table_content">	<font color="red">*</font>地域：</td>
							    <td width="18%" height="40px" class="table_content" align="left" class="table_content">
							    	<s:select 
								       name="request.area"
								       id="area"
								       headerKey="-1" headerValue="选择地区"
								       list="#{'市区':'市区','亭湖':'亭湖','盐都':'盐都', '东台':'东台', '大丰':'大丰', '建湖':'建湖','射阳':'射阳','阜宁':'阜宁','滨海':'滨海','响水':'响水'}"
								       value="%{request.area}"
								       theme="simple"
								       required="true" 
								       cssStyle="width:90%;margin-left:5px">
								    </s:select>
								</td>
							    <td width="18%" height="40px" class="table_content" align="right" class="table_content">	<font color="red">*</font>业务类型：</td>
							    <td width="14%" height="40px" class="table_content" align="left" class="table_content">
									<s:select 
								       name="request.serviceType"
								       id="serviceType"
								       headerKey="-1" headerValue="请选择"
								       list="#{'电话':'电话', '宽带':'宽带', 'ITV':'ITV'}"
								       value="%{request.serviceType}"
								       theme="simple"
								       required="true" 
								       cssStyle="width:90%;margin-left:5px">
								    </s:select>
								</td>
							    <td width="18%" height="40px" class="table_content" align="right" class="table_content">	<font color="red">*</font>业务号码：</td>
							    <td width="18%" height="40px" class="table_content" align="left" class="table_content">
							    	<s:textfield 
								   		name="request.serviceNum"
								   		id="serviceNum"
								   		cssStyle="width:90%;margin-left:5px"
								   		value="%{request.serviceNum}"
							   		/>
							    </td>    
							  </tr>
							  <tr>
							    <td colspan="6" height="25px" bgcolor="#E6E6FA" class="table_content"><strong>装维人员信息</strong></td>
							  </tr>
							  <tr>
							    <td width="14%" height="40px" class="table_content" align="right" class="table_content">姓名：</td>
							    <td width="18%" height="40px" class="table_content" align="left" class="table_content">
							    	<s:textfield 
								   		name="request.masterName"
								   		id="masterName"
								   		cssStyle="width:90%;margin-left:5px"
								   		value="%{request.masterName}"
							   		/>
								</td>
							    <td width="14%" height="40px" class="table_content" align="right" class="table_content">	<font color="red">*</font>号码：</td>
							    <td width="18%" height="40px" class="table_content" align="left"  class="table_content">
							    <s:textfield 
								   		name="request.masterNum"
								   		id="masterNum"
								   		cssStyle="width:90%;margin-left:5px"
								   		value="%{request.masterNum}"
							   		/>
							    </td>
							     <td width="14%" height="40px" class="table_content" align="right" class="table_content">	<font color="red">*</font>催修次数：</td>
							    <td width="18%" height="40px" class="table_content" align="left"  class="table_content">
							    <s:textfield 
								   		name="request.repeatCall"
								   		id="repeatCall"
								   		cssStyle="width:70%;margin-left:5px"
								   		value="%{request.repeatCall}"
							   		/>&nbsp;&nbsp;次
							    </td>
							  </tr>
							  <tr>
							    <td colspan="6" height="25px" bgcolor="#E6E6FA" class="table_content"><strong>支撑需求信息</strong></td>
							  </tr>
							  <tr>
							    <td width="14%" height="40px" class="table_content" align="right" class="table_content">	<font color="red">*</font>支撑类别：</td>
							    <td width="18%" height="40px" class="table_content" align="left" class="table_content">
							    	<s:select 
								       name="request.supportType"
								       id="supportType"
								       headerKey="-1" headerValue="选择支撑类型"
								       list="#{'装机':'装机', '障碍':'障碍'}"
								       value="%{request.supportType}"
								       theme="simple"
								       required="true" 
								       cssStyle="width:90%;margin-left:5px">
								    </s:select>
							    </td>
							    <td width="18%" height="40px" class="table_content" align="right" class="table_content"><font color="red">*</font>故障现象：</td>
							    <td width="14%" height="40px" class="table_content" align="left" class="table_content">
							    	<s:select 
									   name="request.productType"
								       id="type"
								       headerKey="-1" headerValue="请选择"
								       listKey="name"
								       listValue="name"
								       list="allServiceType"
								       theme="simple"
								       required="true" 
								       cssStyle="width:90%;margin-left:5px"
								       value="%{request.productType}"								       
									   onchange="javascript:getCom();"/>
								</td>
							    <td width="36%" height="25px" class="table_content" align="left" colspan="2" class="table_content">
									
              						<s:select 
									   name="request.symptom"
								       id="symptom"
								       headerKey="-1" headerValue="请先选择产品类型"
								       listKey="name"
								       listValue="name"
								       list="allSymptom"
								       theme="simple"
								       required="true" 
								       cssStyle="width:90%;margin-left:5px"
								       value="%{request.symptom}"	/>
								</td>
							  </tr>
							  <tr>
							    <td colspan="6" height="25px" bgcolor="#E6E6FA" class="table_content"><strong>备注信息</strong></td>
							  </tr>
							  
							  <tr>
							    <td class="table_content" height="60px" class="table_content" align="right" >备注：</td>
							    <td colspan="5" class="table_content" align="left">
							    	<s:textarea
									name="request.note"
									id="note"
									rows="5"
									cssStyle="width:88%;margin-left:5px;margin-top:10px;"									
									>
										<s:param name="value">
	            							<s:property value="request.note" escape="false"/>
	        							</s:param>
        							</s:textarea>
								</td>
							  </tr>
							  <tr>
					            <td height="5px" colspan="6">&nbsp;</td>
					          </tr>
							  <tr>
							  	<td height="20px" colspan="3" class="table_content" align="right"></td>
							  	<td height="20px" class="table_content" align="left"><s:submit onclick="javascript:check(requestInputForm);return false;" value="保存"/></td>				  	
							  	<td height="20px" class="table_content" align="left"><s:reset onclick = "javascript:resetBtn(requestInputForm);return false; " value="重置"/></td>
							  	<td height="20px" class="table_content" align="right"></td>
							  </tr>
							</table>
							<s:hidden name="request.id" value="%{request.id}"/>
							</s:form>
						</td>
		          </tr>
		          
		          <tr>
		            <td height="5" colspan="2">&nbsp;</td>
		          </tr>
		         </table>
			</td>
			<td background="images/mail_rightbg.gif">
				&nbsp;
			</td>
			</tr>
			<tr>
			    <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
			    <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
			    <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
		  	</tr>
		</table>
	</body>

</html>
